<%-- 
    Document   : live
    Created on : Apr 22, 2013, 2:15:08 PM
    Author     : clement
--%>

<%@page import="java.sql.Connection"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.io.FileOutputStream"%>
<%@page import="java.io.ObjectOutputStream"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.util.List"%>
<%@page import="java.rmi.Naming"%>
<%@page import="com.rie06.rmi.*"%>


<%-- 
### Start header template ###
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="header.html" %>
<script type="text/javascript">
    function getLive() {
        var val_iprmiserver = $("#iprmiserver").val();
        if ($("#checkmemory").prop('checked')) {
            var val_checkmemory = 1;
        } else {
            var val_checkmemory = 0;
        }

        if ($("#checkcpu").prop('checked')) {
            var val_checkcpu = 1;
        } else {
            var val_checkcpu = 0;
        }

        if ($("#checkprocessus").prop('checked')) {
            var val_checkprocessus = 1;
        } else {
            var val_checkprocessus = 0;
        }
        $.ajax({
            type: "POST",
            url: "live",
            data: "iprmiserver=" + val_iprmiserver + "&memory=" + val_checkmemory + "&cpu=" + val_checkcpu + "&processus=" + val_checkprocessus,
            success: function(msg) {
                $('#servletcontainer').html(msg);
            }
        });
    }
</script>
<header class="jumbotron subhead" id="overview">
    <div class="container">
        <h1>Live</h1>
        <br />
        <form method="POST" action="" class="form-horizontal" id="serverconfig" >
            <div class="control-group">
                <label class="control-label" for="IpRmi">IP du Serveur: </label>
                <div class="controls">
                    <input type="text" id="iprmiserver" name="iprmiserver" value="127.0.0.1" placeholder="IP du Serveur" />
                </div>
                <div class="controls">
                    <label class="checkbox">
                        <input type="checkbox" id="checkmemory" name="memory" value="1" /> Mémoire libre
                    </label>
                    <label class="checkbox">
                        <input type="checkbox" id="checkcpu" name="cpu" value="1" /> CPU utilisé
                    </label>
                    <label class="checkbox">
                        <input type="checkbox" id="checkprocessus" name="processus" value="1" /> Liste des processus
                    </label>
                </div>
                <div class="controls">
                    <input type="button" value="Get" onclick="javascript:getLive();" class="btn btn-success" />
                </div>
            </div>
        </form>
    </div>
</header>
<div class="container monitoring_wrapper">
    <div class="row">
        <div class="span9">

            <%--
### End header template ###
            --%>

            <div id="servletcontainer">
                <script type="text/javascript">getLive();</script>
            </div>

            <%-- 
### Start footer template ###
            --%>    
        </div>
    </div>
</div>
<%@ include file="footer.html" %>
<%-- 
### End footer template ###
--%>    